import { reactive, ref } from '@vue/composition-api'
import { GetCategoryAll } from '@/api/news'

export function common(){
  const categoryItem = reactive({
    item: []
  })
  /**
   * 获取分类
   */
  const getInfoCategory = () => {
    GetCategoryAll().then(response => {
      categoryItem.item = response.data.data
    }).catch(error => {

    })
  }

  return {
    categoryItem,
    getInfoCategory
  }
}
